package java_exceptions;

public class Practice4{
	static int divide (int x, int y){
		if (y == 0){
			throw new IllegalArgumentException
			        ("denominator can not be 0");
		}else {
			return x / y;
		}
	}
	public static void main(String[] args) {
		try {
			System.out.println(divide(10,2));
			System.out.println(divide(10,0));
		}catch(IllegalArgumentException e){
			System.out.println(e.toString());
		}
	}
}
